package com.eningqu.aipen.demo.bean;

import android.os.Parcel;
import android.os.Parcelable;

public class NQPoint implements Parcelable {
    public int dotType;//1:DrawTouchDownProcess,2:DrawTouchMoveProcess
    public int page;//有效号码，包括页码
    public long time;//时间，时间戳
    public int x;
    public int y;
    public int thickness;
    public int color;

    public NQPoint(int dotType, int page, long time, int x, int y, int thickness, int color) {
        this.dotType = dotType;
        this.page = page;
        this.time = time;
        this.x = x;
        this.y = y;
        this.thickness = thickness;
        this.color = color;
    }

    protected NQPoint(Parcel in) {
        dotType = in.readInt();
        page = in.readInt();
        time = in.readLong();
        x = in.readInt();
        y = in.readInt();
        thickness = in.readInt();
        color = in.readInt();
    }

    public static final Creator<NQPoint> CREATOR = new Creator<NQPoint>() {
        @Override
        public NQPoint createFromParcel(Parcel in) {
            return new NQPoint(in);
        }

        @Override
        public NQPoint[] newArray(int size) {
            return new NQPoint[size];
        }
    };

    public String print() {
        return dotType + "," + page + "," + time + "," + x + "," + y + "," + thickness + "," + color + ",";
    }

    public int getDotType() {
        return dotType;
    }

    public int getPage() {
        return page;
    }

    public long getTime() {
        return time;
    }

    public int getX() {
        return x;
    }

    public int getY() {
        return y;
    }

    public int getThickness() {
        return thickness;
    }

    public int getColor() {
        return color;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(dotType);
        dest.writeInt(page);
        dest.writeLong(time);
        dest.writeInt(x);
        dest.writeInt(y);
        dest.writeInt(thickness);
        dest.writeInt(color);
    }
}